import React from 'react';
import { Redirect } from 'umi';
const Wrapper = (props: any) => {
  const token = localStorage.getItem('token');
  if (token) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/login" />;
  }
};

export default Wrapper;
